/* eslint-disable */
export function sqlTip(
  range,
  monaco,
  wordkey,
  tablelist,
  tablefild,
  sqlcontext
) {
  const keycodes = [
    'accessible',
    'account',
    'action',
    'add',
    'after',
    'against',
    'aggregate',
    'algorithm',
    'all',
    'alter',
    'always',
    'analyse',
    'analyze',
    'and',
    'any',
    'as',
    'asc',
    'ascii',
    'asensitive',
    'at',
    'autoextend_size',
    'auto_increment',
    'avg',
    'avg_row_length',
    'backup',
    'before',
    'begin',
    'between',
    'bigint',
    'binary',
    'binlog',
    'bit',
    'blob',
    'block',
    'bool',
    'boolean',
    'both',
    'btree',
    'by',
    'byte',
    'cache',
    'call',
    'cascade',
    'cascaded',
    'case',
    'catalog_name',
    'chain',
    'change',
    'changed',
    'channel',
    'char',
    'character',
    'charset',
    'check',
    'checksum',
    'cipher',
    'class_origin',
    'client',
    'close',
    'coalesce',
    'code',
    'collate',
    'collation',
    'column',
    'columns',
    'column_format',
    'column_name',
    'comment',
    'commit',
    'committed',
    'compact',
    'completion',
    'compressed',
    'compression',
    'concurrent',
    'condition',
    'connection',
    'consistent',
    'constraint',
    'constraint_catalog',
    'constraint_name',
    'constraint_schema',
    'contains',
    'context',
    'continue',
    'convert',
    'cpu',
    'create',
    'cross',
    'cube',
    'current',
    'current_date',
    'current_time',
    'current_timestamp',
    'current_user',
    'cursor',
    'cursor_name',
    'data',
    'database',
    'databases',
    'datafile',
    'date',
    'datetime',
    'day',
    'day_hour',
    'day_microsecond',
    'day_minute',
    'day_second',
    'deallocate',
    'dec',
    'decimal',
    'declare',
    'default',
    'default_auth',
    'definer',
    'delayed',
    'delay_key_write',
    'delete',
    'desc',
    'describe',
    'des_key_file',
    'deterministic',
    'diagnostics',
    'directory',
    'disable',
    'discard',
    'disk',
    'distinct',
    'distinctrow',
    'div',
    'do',
    'double',
    'drop',
    'dual',
    'dumpfile',
    'duplicate',
    'dynamic',
    'each',
    'else',
    'elseif',
    'enable',
    'enclosed',
    'encryption',
    'end',
    'ends',
    'engine',
    'engines',
    'enum',
    'error',
    'errors',
    'escape',
    'escaped',
    'event',
    'events',
    'every',
    'exchange',
    'execute',
    'exists',
    'exit',
    'expansion',
    'expire',
    'explain',
    'export',
    'extended',
    'extent_size',
    'false',
    'fast',
    'faults',
    'fetch',
    'fields',
    'file',
    'file_block_size',
    'filter',
    'first',
    'fixed',
    'float',
    'float4',
    'float8',
    'flush',
    'follows',
    'for',
    'force',
    'foreign',
    'format',
    'found',
    'from',
    'full',
    'fulltext',
    'function',
    'general',
    'generated',
    'geometry',
    'geometrycollection',
    'get',
    'get_format',
    'global',
    'grant',
    'grants',
    'group',
    'group_replication',
    'handler',
    'hash',
    'having',
    'help',
    'high_priority',
    'host',
    'hosts',
    'hour',
    'hour_microsecond',
    'hour_minute',
    'hour_second',
    'identified',
    'if',
    'ignore',
    'ignore_server_ids',
    'import',
    'index',
    'indexes',
    'infile',
    'initial_size',
    'inner',
    'inout',
    'insensitive',
    'insert',
    'insert_method',
    'install',
    'instance',
    'int',
    'int1',
    'int2',
    'int3',
    'int4',
    'int8',
    'integer',
    'interval',
    'into',
    'invoker',
    'io',
    'io_after_gtids',
    'io_before_gtids',
    'io_thread',
    'ipc',
    'isolation',
    'issuer',
    'iterate',
    'join',
    'json',
    'key',
    'keys',
    'key_block_size',
    'kill',
    'language',
    'last',
    'leading',
    'leave',
    'leaves',
    'left',
    'less',
    'level',
    'like',
    'limit',
    'linear',
    'lines',
    'linestring',
    'list',
    'load',
    'local',
    'localtime',
    'localtimestamp',
    'lock',
    'locks',
    'logfile',
    'logs',
    'long',
    'longblob',
    'longtext',
    'loop',
    'low_priority',
    'master',
    'master_auto_position',
    'master_bind',
    'master_connect_retry',
    'master_delay',
    'master_heartbeat_period',
    'master_host',
    'master_log_file',
    'master_log_pos',
    'master_password',
    'master_port',
    'master_retry_count',
    'master_server_id',
    'master_ssl',
    'master_ssl_ca',
    'master_ssl_capath',
    'master_ssl_cert',
    'master_ssl_cipher',
    'master_ssl_crl',
    'master_ssl_crlpath',
    'master_ssl_key',
    'master_ssl_verify_server_cert',
    'master_tls_version',
    'master_user',
    'match',
    'maxvalue',
    'max_connections_per_hour',
    'max_queries_per_hour',
    'max_rows',
    'max_size',
    'max_statement_time',
    'max_updates_per_hour',
    'max_user_connections',
    'medium',
    'mediumblob',
    'mediumint',
    'mediumtext',
    'memory',
    'merge',
    'message_text',
    'microsecond',
    'middleint',
    'migrate',
    'minute',
    'minute_microsecond',
    'minute_second',
    'min_rows',
    'mod',
    'mode',
    'modifies',
    'modify',
    'month',
    'multilinestring',
    'multipoint',
    'multipolygon',
    'mutex',
    'mysql_errno',
    'name',
    'names',
    'national',
    'natural',
    'nchar',
    'ndb',
    'ndbcluster',
    'never',
    'new',
    'next',
    'no',
    'nodegroup',
    'nonblocking',
    'none',
    'no_wait',
    'no_write_to_binlog',
    'number',
    'numeric',
    'nvarchar',
    'offset',
    'old_password',
    'on',
    'one',
    'only',
    'open',
    'optimize',
    'optimizer_costs',
    'option',
    'optionally',
    'options',
    'or',
    'order',
    'out',
    'outer',
    'outfile',
    'owner',
    'pack_keys',
    'page',
    'parser',
    'parse_gcol_expr',
    'partial',
    'partition',
    'partitioning',
    'partitions',
    'password',
    'phase',
    'plugin',
    'plugins',
    'plugin_dir',
    'point',
    'polygon',
    'port',
    'precedes',
    'precision',
    'prepare',
    'preserve',
    'prev',
    'primary',
    'privileges',
    'procedure',
    'processlist',
    'profile',
    'profiles',
    'proxy',
    'purge',
    'quarter',
    'query',
    'quick',
    'range',
    'read',
    'reads',
    'read_only',
    'read_write',
    'real',
    'rebuild',
    'recover',
    'redofile',
    'redo_buffer_size',
    'redundant',
    'references',
    'regexp',
    'relay',
    'relaylog',
    'relay_log_file',
    'relay_log_pos',
    'relay_thread',
    'release',
    'reload',
    'remove',
    'rename',
    'reorganize',
    'repair',
    'repeat',
    'repeatable',
    'replace',
    'replicate_do_db',
    'replicate_do_table',
    'replicate_ignore_db',
    'replicate_ignore_table',
    'replicate_rewrite_db',
    'replicate_wild_do_table',
    'replicate_wild_ignore_table',
    'replication',
    'require',
    'reset',
    'resignal',
    'restore',
    'restrict',
    'resume',
    'return',
    'returned_sqlstate',
    'returns',
    'reverse',
    'revoke',
    'right',
    'rlike',
    'rollback',
    'rollup',
    'rotate',
    'routine',
    'row',
    'rows',
    'row_count',
    'row_format',
    'rtree',
    'savepoint',
    'schedule',
    'schema',
    'schemas',
    'schema_name',
    'second',
    'second_microsecond',
    'security',
    'select',
    'sensitive',
    'separator',
    'serial',
    'serializable',
    'server',
    'session',
    'set',
    'share',
    'show',
    'shutdown',
    'signal',
    'signed',
    'simple',
    'slave',
    'slow',
    'smallint',
    'snapshot',
    'socket',
    'some',
    'soname',
    'sounds',
    'source',
    'spatial',
    'specific',
    'sql',
    'sqlexception',
    'sqlstate',
    'sqlwarning',
    'sql_after_gtids',
    'sql_after_mts_gaps',
    'sql_before_gtids',
    'sql_big_result',
    'sql_buffer_result',
    'sql_cache',
    'sql_calc_found_rows',
    'sql_no_cache',
    'sql_small_result',
    'sql_thread',
    'sql_tsi_day',
    'sql_tsi_hour',
    'sql_tsi_minute',
    'sql_tsi_month',
    'sql_tsi_quarter',
    'sql_tsi_second',
    'sql_tsi_week',
    'sql_tsi_year',
    'ssl',
    'stacked',
    'start',
    'starting',
    'starts',
    'stats_auto_recalc',
    'stats_persistent',
    'stats_sample_pages',
    'status',
    'stop',
    'storage',
    'stored',
    'straight_join',
    'string',
    'subclass_origin',
    'subject',
    'subpartition',
    'subpartitions',
    'super',
    'suspend',
    'swaps',
    'switches',
    'table',
    'tables',
    'tablespace',
    'table_checksum',
    'table_name',
    'temporary',
    'temptable',
    'terminated',
    'text',
    'than',
    'then',
    'time',
    'timestamp',
    'timestampadd',
    'timestampdiff',
    'tinyblob',
    'tinyint',
    'tinytext',
    'to',
    'trailing',
    'transaction',
    'trigger',
    'triggers',
    'true',
    'truncate',
    'type',
    'types',
    'uncommitted',
    'undefined',
    'undo',
    'undofile',
    'undo_buffer_size',
    'unicode',
    'uninstall',
    'union',
    'unique',
    'unknown',
    'unlock',
    'unsigned',
    'until',
    'update',
    'upgrade',
    'usage',
    'use',
    'user',
    'user_resources',
    'use_frm',
    'using',
    'utc_date',
    'utc_time',
    'utc_timestamp',
    'validation',
    'value',
    'values',
    'varbinary',
    'varchar',
    'varcharacter',
    'variables',
    'varying',
    'view',
    'virtual',
    'wait',
    'warnings',
    'week',
    'weight_string',
    'when',
    'where',
    'while',
    'with',
    'without',
    'work',
    'wrapper',
    'write',
    'x509',
    'xa',
    'xid',
    'xml',
    'xor',
    'year',
    'year_month',
    'zerofill',
    'and',
    'between',
    'in',
    'like',
    'not',
    'or',
    'is',
    'null',
    'intersect',
    'union',
    'inner',
    'join',
    'left',
    'outer',
    'right',
    'abs',
    'acos',
    'adddate',
    'addtime',
    'aes_decrypt',
    'aes_encrypt',
    'any_value',
    'area',
    'asbinary',
    'aswkb',
    'ascii',
    'asin',
    'astext',
    'aswkt',
    'asymmetric_decrypt',
    'asymmetric_derive',
    'asymmetric_encrypt',
    'asymmetric_sign',
    'asymmetric_verify',
    'atan',
    'atan2',
    'atan',
    'avg',
    'benchmark',
    'bin',
    'bit_and',
    'bit_count',
    'bit_length',
    'bit_or',
    'bit_xor',
    'buffer',
    'cast',
    'ceil',
    'ceiling',
    'centroid',
    'char',
    'char_length',
    'character_length',
    'charset',
    'coalesce',
    'coercibility',
    'collation',
    'compress',
    'concat',
    'concat_ws',
    'connection_id',
    'contains',
    'conv',
    'convert',
    'convert_tz',
    'convexhull',
    'cos',
    'cot',
    'count',
    'crc32',
    'create_asymmetric_priv_key',
    'create_asymmetric_pub_key',
    'create_dh_parameters',
    'create_digest',
    'crosses',
    'curdate',
    'current_date',
    'current_time',
    'current_timestamp',
    'current_user',
    'curtime',
    'database',
    'date',
    'date_add',
    'date_format',
    'date_sub',
    'datediff',
    'day',
    'dayname',
    'dayofmonth',
    'dayofweek',
    'dayofyear',
    'decode',
    'default',
    'degrees',
    'des_decrypt',
    'des_encrypt',
    'dimension',
    'disjoint',
    'distance',
    'elt',
    'encode',
    'encrypt',
    'endpoint',
    'envelope',
    'equals',
    'exp',
    'export_set',
    'exteriorring',
    'extract',
    'extractvalue',
    'field',
    'find_in_set',
    'floor',
    'format',
    'found_rows',
    'from_base64',
    'from_days',
    'from_unixtime',
    'geomcollfromtext',
    'geometrycollectionfromtext',
    'geomcollfromwkb',
    'geometrycollectionfromwkb',
    'geometrycollection',
    'geometryn',
    'geometrytype',
    'geomfromtext',
    'geometryfromtext',
    'geomfromwkb',
    'geometryfromwkb',
    'get_format',
    'get_lock',
    'glength',
    'greatest',
    'group_concat',
    'gtid_subset',
    'gtid_subtract',
    'hex',
    'hour',
    'if',
    'ifnull',
    'inet_aton',
    'inet_ntoa',
    'inet6_aton',
    'inet6_ntoa',
    'insert',
    'instr',
    'interiorringn',
    'intersects',
    'interval',
    'is_free_lock',
    'is_ipv4',
    'is_ipv4_compat',
    'is_ipv4_mapped',
    'is_ipv6',
    'is_used_lock',
    'isclosed',
    'isempty',
    'isnull',
    'issimple',
    'json_append',
    'json_array',
    'json_array_append',
    'json_array_insert',
    'json_contains',
    'json_contains_path',
    'json_depth',
    'json_extract',
    'json_insert',
    'json_keys',
    'json_length',
    'json_merge',
    'json_merge_preserve',
    'json_object',
    'json_quote',
    'json_remove',
    'json_replace',
    'json_search',
    'json_set',
    'json_type',
    'json_unquote',
    'json_valid',
    'last_insert_id',
    'lcase',
    'least',
    'left',
    'length',
    'linefromtext',
    'linestringfromtext',
    'linefromwkb',
    'linestringfromwkb',
    'linestring',
    'ln',
    'load_file',
    'localtime',
    'localtimestamp',
    'locate',
    'log',
    'log10',
    'log2',
    'lower',
    'lpad',
    'ltrim',
    'make_set',
    'makedate',
    'maketime',
    'master_pos_wait',
    'max',
    'mbrcontains',
    'mbrcoveredby',
    'mbrcovers',
    'mbrdisjoint',
    'mbrequal',
    'mbrequals',
    'mbrintersects',
    'mbroverlaps',
    'mbrtouches',
    'mbrwithin',
    'md5',
    'microsecond',
    'mid',
    'min',
    'minute',
    'mlinefromtext',
    'multilinestringfromtext',
    'mlinefromwkb',
    'multilinestringfromwkb',
    'mod',
    'month',
    'monthname',
    'mpointfromtext',
    'multipointfromtext',
    'mpointfromwkb',
    'multipointfromwkb',
    'mpolyfromtext',
    'multipolygonfromtext',
    'mpolyfromwkb',
    'multipolygonfromwkb',
    'multilinestring',
    'multipoint',
    'multipolygon',
    'name_const',
    'not in',
    'now',
    'nullif',
    'numgeometries',
    'numinteriorrings',
    'numpoints',
    'oct',
    'octet_length',
    'old_password',
    'ord',
    'overlaps',
    'password',
    'period_add',
    'period_diff',
    'pi',
    'point',
    'pointfromtext',
    'pointfromwkb',
    'pointn',
    'polyfromtext',
    'polygonfromtext',
    'polyfromwkb',
    'polygonfromwkb',
    'polygon',
    'position',
    'pow',
    'power',
    'procedure analyse',
    'quarter',
    'quote',
    'radians',
    'rand',
    'random_bytes',
    'release_all_locks',
    'release_lock',
    'repeat',
    'replace',
    'reverse',
    'right',
    'round',
    'row_count',
    'rpad',
    'rtrim',
    'schema',
    'sec_to_time',
    'second',
    'session_user',
    'sha1',
    'sha',
    'sha2',
    'sign',
    'sin',
    'sleep',
    'soundex',
    'space',
    'sqrt',
    'srid',
    'st_area',
    'st_asbinary',
    'st_aswkb',
    'st_asgeojson',
    'st_astext',
    'st_aswkt',
    'st_buffer',
    'st_buffer_strategy',
    'st_centroid',
    'st_contains',
    'st_convexhull',
    'st_crosses',
    'st_difference',
    'st_dimension',
    'st_disjoint',
    'st_distance',
    'st_distance_sphere',
    'st_endpoint',
    'st_envelope',
    'st_equals',
    'st_exteriorring',
    'st_geohash',
    'st_geomcollfromtext',
    'st_geometrycollectionfromtext',
    'st_geomcollfromtxt',
    'st_geomcollfromwkb',
    'st_geometrycollectionfromwkb',
    'st_geometryn',
    'st_geometrytype',
    'st_geomfromgeojson',
    'st_geomfromtext',
    'st_geometryfromtext',
    'st_geomfromwkb',
    'st_geometryfromwkb',
    'st_interiorringn',
    'st_intersection',
    'st_intersects',
    'st_isclosed',
    'st_isempty',
    'st_issimple',
    'st_isvalid',
    'st_latfromgeohash',
    'st_length',
    'st_linefromtext',
    'st_linestringfromtext',
    'st_linefromwkb',
    'st_linestringfromwkb',
    'st_longfromgeohash',
    'st_makeenvelope',
    'st_mlinefromtext',
    'st_multilinestringfromtext',
    'st_mlinefromwkb',
    'st_multilinestringfromwkb',
    'st_mpointfromtext',
    'st_multipointfromtext',
    'st_mpointfromwkb',
    'st_multipointfromwkb',
    'st_mpolyfromtext',
    'st_multipolygonfromtext',
    'st_mpolyfromwkb',
    'st_multipolygonfromwkb',
    'st_numgeometries',
    'st_numinteriorring',
    'st_numinteriorrings',
    'st_numpoints',
    'st_overlaps',
    'st_pointfromgeohash',
    'st_pointfromtext',
    'st_pointfromwkb',
    'st_pointn',
    'st_polyfromtext',
    'st_polygonfromtext',
    'st_polyfromwkb',
    'st_polygonfromwkb',
    'st_simplify',
    'st_srid',
    'st_startpoint',
    'st_symdifference',
    'st_touches',
    'st_union',
    'st_validate',
    'st_within',
    'st_x',
    'st_y',
    'startpoint',
    'std',
    'stddev',
    'stddev_pop',
    'stddev_samp',
    'str_to_date',
    'strcmp',
    'subdate',
    'substr',
    'substring',
    'substring_index',
    'subtime',
    'sum',
    'sysdate',
    'system_user',
    'tan',
    'time',
    'time_format',
    'time_to_sec',
    'timediff',
    'timestamp',
    'timestampadd',
    'timestampdiff',
    'to_base64',
    'to_days',
    'to_seconds',
    'touches',
    'trim',
    'truncate',
    'ucase',
    'uncompress',
    'uncompressed_length',
    'unhex',
    'unix_timestamp',
    'updatexml',
    'upper',
    'user',
    'utc_date',
    'utc_time',
    'utc_timestamp',
    'uuid',
    'uuid_short',
    'validate_password_strength',
    'values',
    'var_pop',
    'var_samp',
    'variance',
    'version',
    'wait_for_executed_gtid_set',
    'wait_until_sql_thread_after_gtids',
    'week',
    'weekday',
    'weekofyear',
    'weight_string',
    'within',
    'x',
    'y',
    'year',
    'yearweek',
  ]
  const fun = monaco.languages.CompletionItemKind.Function
  const monaco_Field = monaco.languages.CompletionItemKind.Field
  const monaco_Class = monaco.languages.CompletionItemKind.Class
  const monaco_Property = monaco.languages.CompletionItemKind.Property
  const TipStrs = [
    {
      label: '<where>',
      kind: fun,
      documentation: '条件',
      insertText: '<where><if test=""></if></where>',
      range: range,
    },
    {
      label: '<sql>',
      kind: fun,
      documentation: '语句块',
      insertText: '<sql test="" paramname=""><sql>',
      range: range,
    },
    {
      label: '<for',
      kind: fun,
      documentation: '语句块',
      insertText: '<for test="" forname=""></for>',
      range: range,
    },
    {
      label: '#{$user.userId}',
      kind: fun,
      documentation: '用户ID',
      insertText: '#{$user.userId}',
      range: range,
    },
    {
      label: '#{$user.userName}',
      kind: fun,
      documentation: '用户名称',
      insertText: '#{$user.userName}',
      range: range,
    },
    {
      label: '#{$user.realaname}',
      kind: fun,
      documentation: '用户真实名称',
      insertText: '#{$user.realaname}',
      range: range,
    },
    {
      label: '#{$user.deptcode}',
      kind: fun,
      documentation: '部门编码',
      insertText: '#{$user.deptcode}',
      range: range,
    },
    {
      label: '#{$user.deptname}',
      kind: fun,
      documentation: '当前部门名称',
      insertText: '#{$user.deptname}',
      range: range,
    },
    {
      label: '#{$user.organcode}',
      kind: fun,
      documentation: '当前机构编码',
      insertText: '#{$user.organcode}',
      range: range,
    },
    {
      label: '#{$user.organname}',
      kind: fun,
      documentation: '当前机构名称',
      insertText: '#{$user.organname}',
      range: range,
    },
    {
      label: '#{$user.deptid}',
      kind: fun,
      documentation: '当前部门ID',
      insertText: '#{$user.deptid}',
      range: range,
    },
    {
      label: '#{$user.organid}',
      kind: fun,
      documentation: '当前机构ID',
      insertText: '#{$user.organid}',
      range: range,
    },
    {
      label: '#{$user.phone}',
      kind: fun,
      documentation: '手机号',
      insertText: '#{$user.phone}',
      range: range,
    },
    {
      label: '#{$user.avatar}',
      kind: fun,
      documentation: '当前头像',
      insertText: '{$user.avatar}',
      range: range,
    },
    {
      label: '#{$newid}',
      kind: fun,
      documentation: 'newID',
      insertText: '{$newid}',
      range: range,
    },
    {
      label: '#{$index}',
      kind: fun,
      documentation: '循坏索引',
      insertText: '#{$index}',
      range: range,
    },
    {
      label: '#{$query.}',
      kind: fun,
      documentation: '获取url参数',
      insertText: '#{$query.}',
      range: range,
    },
    {
      label: '#{$header.}',
      kind: fun,
      documentation: '获取header参数',
      insertText: '#{$header.}',
      range: range,
    },
    {
      label: 'like',
      kind: fun,
      documentation: '模糊查询',
      insertText: ` like  CONCAT('%',#{},'%') `,
      range: range,
    },
    {
      label: 'now()',
      kind: fun,
      documentation: '获取当前时间',
      insertText: 'now()',
      range: range,
    },
    {
      label: 'cast',
      kind: fun,
      documentation: '字符串转数字',
      insertText: 'CAST(字符串 AS SIGNED)',
      range: range,
    },
    {
      label: 'replace',
      kind: fun,
      documentation: '替换字符串',
      insertText: 'replace(s,s1,s2)',
      range: range,
    },
  ]
  const tiptablelist = []
  if (tablelist !== undefined) {
    tablelist.forEach((ee) => {
      if (
        ee !== undefined &&
        ee.tablename !== undefined &&
        ee.tablename.indexOf(wordkey.trim()) >= 0
      ) {
        TipStrs.push({
          label: ee.tablename,
          kind: monaco_Class,
          documentation: '',
          insertText: ee.tablename,
          range: range,
        })
      }
      if (sqlcontext !== undefined && sqlcontext.indexOf(ee.tablename) >= 0) {
        tiptablelist.push(ee.tablename)
      }
    })
  }
  keycodes.forEach((ee) => {
    if (ee !== undefined && ee.indexOf(wordkey.trim()) >= 0) {
      TipStrs.push({
        label: ee,
        kind: fun,
        documentation: '',
        insertText: ee,
        range: range,
      })
    }
  })

  if (wordkey == '#') {
    tablelist.forEach((tableitem) => {
      const tablename = tableitem.tablename
      if (tablefild[tablename] != undefined) {
        let setstr = ' flastupdatedate=now(),flastupdateby=#{$user.userId} '
        let insertfild = ''
        let insertfildvalue = ''
        for (let index = 0; index < tablefild[tablename].length; index++) {
          const ee = tablefild[tablename][index]
          insertfild =
            insertfild === '' ? ee.ColumnName : insertfild + ',' + ee.ColumnName
          switch (ee.ColumnName) {
            case 'fid':
              insertfildvalue =
                insertfildvalue === ''
                  ? '#{$newid}'
                  : insertfildvalue + ',#{$newid}'
              break
            case 'fcreationdate':
              insertfildvalue =
                insertfildvalue === '' ? 'now()' : insertfildvalue + ',now()'
              break
            case 'fcreateby':
              insertfildvalue =
                insertfildvalue === ''
                  ? '#{$user.userId}'
                  : insertfildvalue + ',#{$user.userId}'
              break
            case 'flastupdatedate':
              insertfildvalue =
                insertfildvalue === '' ? 'now()' : insertfildvalue + ',now()'
              break
            case 'flastupdateby':
              insertfildvalue =
                insertfildvalue === ''
                  ? '#{$user.userId}'
                  : insertfildvalue + ',#{$user.userId}'
              break
            default:
              insertfildvalue =
                insertfildvalue === ''
                  ? `#{${ee.ColumnName}}`
                  : insertfildvalue + `,#{${ee.ColumnName}}`
              setstr =
                setstr +
                `<if test="${ee.ColumnName}!=null and ${ee.ColumnName}!=''">, ${ee.ColumnName}=#{${ee.ColumnName}}</if>`
              break
          }
        }
        const insertsql = `insert into ${tablename}(${insertfild}) values(${insertfildvalue})`
        const update = `update  ${tablename} set ${setstr}  where fid=#{fid}`
        TipStrs.push({
          label: '#IN' + tablename,
          kind: fun,
          documentation: '',
          insertText: insertsql,
          range: range,
        })
        TipStrs.push({
          label: '#UP' + tablename,
          kind: fun,
          documentation: '',
          insertText: update,
          range: range,
        })
      }
    })
  }
  if (wordkey !== undefined && wordkey.indexOf('.') >= 0) {
    const tables = wordkey.split('.')
    const tablename = tables[tables.length - 2]
    if (tablefild[tablename] != undefined) {
      tablefild[tablename].forEach((ee) => {
        TipStrs.push({
          label: tablename + '.' + ee.ColumnName,
          kind: monaco_Property,
          documentation: ee.DeText,
          insertText: ee.ColumnName,
          range: range,
        })
      })
    }
  }

  ///查询表 就将字段自定义提示
  tiptablelist.forEach((ee) => {
    if (tablefild[ee] != undefined) {
      tablefild[ee].forEach((ff) => {
        const existList = TipStrs.filter((tt) => {
          return tt.insertText == ff.ColumnName
        })
        if (existList.length == 0) {
          TipStrs.push({
            label: ff.ColumnName,
            kind: monaco_Field,
            documentation: ff.DeText,
            insertText: ff.ColumnName,
            range: range,
          })
        }
      })
    }
  })
  return TipStrs.filter((item) => {
    return item.label.indexOf(wordkey.trim()) >= 0
  })
}
